-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add angular unit radian #49
Conversation
Codecov Report
@@ Coverage Diff @@
## master #49 +/- ##
==========================================
+ Coverage 84.68% 85.06% +0.38%
==========================================
Files 10 10
Lines 235 241 +6
==========================================
+ Hits 199 205 +6
Misses 36 36
Continue to review full report at Codecov.
|
@@ -23,7 +26,11 @@ object base { | |||
* @tparam F the unit to convert from | |||
* @tparam T the unit to convert to | |||
*/ | |||
case class ConversionFactor[A, D, F <: UnitOfMeasure[D], T <: UnitOfMeasure[D]](val value: A) | |||
case class ConversionFactor[A, D, F <: UnitOfMeasure[D], T <: UnitOfMeasure[D]](val value: A) { | |||
def compose[OtherF <: UnitOfMeasure[D]](otherConversionFactor: ConversionFactor[A, D, OtherF, F]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a really nice helper function 👍
There was a previous attempt at trying to compose conversion factors implicitly, i.e given an implicit ConversionFactor[P, Q, A, B]
and an implicit ConversionFactor[P, Q, B, C]
, produce a ConversionFactor[P, Q, A, C]
. However, this couldn't be picked up by scala's implicit resolution. I'll keep investigating, but this is a good stand in in the meantime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also tried to make it implicitly but i failed (it was above my abilities), i'll be waiting impatiently for results of your investigation :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've created an issue to track it properly #50
This looks great @ldrygala! 👍 |
Add angular unit radian, as referenced in #37